from django.forms import ModelForm

from xadmin.models import UserGroup


class UserGroupForm(ModelForm):
    class Meta:
        model = UserGroup
        exclude = ('site',)

    def __init__(self, *args, **kwargs):
        super(UserGroupForm, self).__init__(*args, **kwargs)
        for field_name in self.fields:
            field = self.fields[field_name]
            field.widget.attrs.update({'class': 'layui-input'})

